load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "tables",
    srcs = [
        "cache.go",
        "index.go",
        "mutation_checker.go",
        "partition.go",
        "state_remote.go",
        "tables.go",
        "testutil.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/table/tables",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/errctx",
        "//pkg/errno",
        "//pkg/expression",
        "//pkg/expression/exprctx",
        "//pkg/expression/exprstatic",
        "//pkg/kv",
        "//pkg/meta/autoid",
        "//pkg/meta/model",
        "//pkg/metrics",
        "//pkg/parser",
        "//pkg/parser/ast",
        "//pkg/parser/model",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/sessionctx",
        "//pkg/sessionctx/variable",
        "//pkg/statistics",
        "//pkg/table",
        "//pkg/table/tblctx",
        "//pkg/tablecodec",
        "//pkg/types",
        "//pkg/util",
        "//pkg/util/chunk",
        "//pkg/util/codec",
        "//pkg/util/collate",
        "//pkg/util/dbterror",
        "//pkg/util/generatedexpr",
        "//pkg/util/hack",
        "//pkg/util/intest",
        "//pkg/util/logutil",
        "//pkg/util/ranger",
        "//pkg/util/rowcodec",
        "//pkg/util/sqlexec",
        "//pkg/util/stringutil",
        "//pkg/util/tableutil",
        "//pkg/util/tracing",
        "@com_github_google_btree//:btree",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_log//:log",
        "@com_github_pingcap_tipb//go-tipb",
        "@com_github_tikv_client_go_v2//oracle",
        "@com_github_tikv_client_go_v2//tikv",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "tables_test",
    timeout = "short",
    srcs = [
        "bench_test.go",
        "cache_test.go",
        "index_test.go",
        "main_test.go",
        "mutation_checker_test.go",
        "state_remote_test.go",
        "tables_test.go",
    ],
    embed = [":tables"],
    flaky = True,
    shard_count = 34,
    deps = [
        "//pkg/ddl",
        "//pkg/domain",
        "//pkg/errctx",
        "//pkg/infoschema",
        "//pkg/kv",
        "//pkg/lightning/backend/encode",
        "//pkg/lightning/backend/kv",
        "//pkg/meta/autoid",
        "//pkg/meta/metabuild",
        "//pkg/meta/model",
        "//pkg/metrics",
        "//pkg/parser",
        "//pkg/parser/ast",
        "//pkg/parser/auth",
        "//pkg/parser/model",
        "//pkg/parser/mysql",
        "//pkg/session",
        "//pkg/session/types",
        "//pkg/sessionctx",
        "//pkg/sessionctx/variable",
        "//pkg/sessiontxn",
        "//pkg/table",
        "//pkg/tablecodec",
        "//pkg/testkit",
        "//pkg/testkit/testsetup",
        "//pkg/types",
        "//pkg/util",
        "//pkg/util/codec",
        "//pkg/util/collate",
        "//pkg/util/context",
        "//pkg/util/logutil",
        "//pkg/util/mock",
        "//pkg/util/rowcodec",
        "//pkg/util/stmtsummary",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_log//:log",
        "@com_github_prometheus_client_model//go",
        "@com_github_stretchr_testify//require",
        "@com_github_tikv_client_go_v2//oracle",
        "@org_uber_go_goleak//:goleak",
    ],
)
